package com.dhu719.label_end.controller;

import com.dhu719.label_end.domain.Patient;
import com.dhu719.label_end.service.PatientService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping(value = "/patient", produces = {"application/json;charset=UTF-8"})
public class PatientController {

    @Autowired
    private PatientService patientService;

    @RequestMapping(value = "find", method = RequestMethod.GET)
    public List<Patient> find(@RequestParam("id") String id){
        return patientService.findPatient(id);
    }
}
